﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.CompositeUI;
using Microsoft.Practices.ObjectBuilder;

namespace StatusBarDemo
{
	public sealed class Module : ModuleInit, IBuilderAware
	{
		private WorkItem _rootWorkItem;

		[InjectionConstructor]
		public Module([ServiceDependency] WorkItem rootWorkItem)
		{
			_rootWorkItem = rootWorkItem;
		}

		void IBuilderAware.OnBuiltUp(string id)
		{
			//run the work item
			_rootWorkItem.WorkItems.AddNew<StatusBarDemoWorkItem>().Run();
		}

		void IBuilderAware.OnTearingDown()
		{
		}
	}
}
